/*************************************************************************
	> File Name: B2139.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-03 16:19:12
 ************************************************************************/
#include <iostream>
#include <vector>
using namespace std;

#define MAX_N 100000

int prime[MAX_N + 5] = {1, 1, 0};

void init() {
    for (int i = 2; i <= MAX_N; i++) {
        if (prime[i]) continue;
        for (int j = i, I = MAX_N / i; j <= I; j++) {
            prime[i * j] = 1;
        }
    }
    return ;
}

int is_val(int n) {
    if (prime[n]) return 0;
    int temp = 0, x = n;
    while (x) {
        temp = temp * 10 + x % 10;
        x /= 10;
    }
    return prime[temp] == 0;
}

int main() {
    init();
    int m, n;
    cin >> m >> n;
    vector<int> ans;
    for (int i = m; i <= n; i++) {
        if (!is_val(i)) continue;
        ans.push_back(i);
    }
    if (ans.size() == 0) {
        cout << "No" << endl;
    } else {
        for (int i = 0; i < ans.size(); i++) {
            if (i) cout << ",";
            cout << ans[i];
        }
        cout << endl;
    }
    return 0;
}
